package com.gopay.common.cps.service.fund.impl;

import com.gopay.common.cps.dao.fund.BindCardDAO;
import com.gopay.common.cps.service.fund.BindCardService;
import com.gopay.common.domain.fund.FundGopayCardEntity;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author baiyunpeng
 * @2016年7月14日 下午3:36:05  www.gopay.com.cn Inc.All rights reserved.
 */

@Service(value = "bindCardService")
public class BindCardServiceImpl implements BindCardService {
    @Resource(name = "bindCardDAO")
    private BindCardDAO bindCardDAO;

    @Override
    public FundGopayCardEntity save(FundGopayCardEntity fundGopayCardEntity) {

        return bindCardDAO.save(fundGopayCardEntity);
    }
    @Override
    public void delete(FundGopayCardEntity fundGopayCardEntity) {
        bindCardDAO.delete(fundGopayCardEntity);
    }
    @Override
    public FundGopayCardEntity getCard(String agentId) {
       return bindCardDAO.getCard(agentId);
    }
    @Override
    public FundGopayCardEntity getValidCard(String agentId) {
       return bindCardDAO.getValidCard(agentId);
    }

    @Override
    public FundGopayCardEntity getValidCard(String agentId, String merId) {
        return bindCardDAO.getValidCard(agentId,merId);
    }

    @Override
    public FundGopayCardEntity findByCriteria(String bankNo) {
        return bindCardDAO.findByCriteria(bankNo);
    }
    @Override
    public List<FundGopayCardEntity> getCardByAgentOrMerOrderId(String agentNo, String merOrderId) {
        return bindCardDAO.getCardByAgentOrMerOrderId(agentNo,merOrderId);
    }

    @Override
    public FundGopayCardEntity getValidCardByAgentAndCardNo(String agentId, String cardNo) {
        return bindCardDAO.getValidCardByAgentAndCardNo(agentId, cardNo);
    }

    @Override
    public FundGopayCardEntity getValidCardByAgentAndMerIdAndCardNo(String agentId, String merId, String cardNo) {
        return bindCardDAO.getValidCardByAgentAndMerIdAndCardNo(agentId, cardNo, cardNo);
    }
}
